package com.duan.exception;

import com.duan.utils.AppHttpCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author db
 * @version 1.0
 * @description SecurityExceptionHandler
 * @since 2024/9/22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SpringSecurityException extends RuntimeException{
    private int code;
    private String msg;

    public SpringSecurityException(AppHttpCodeEnum httpCodeEnum) {
        super(httpCodeEnum.getMsg());
        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();
    }
}
